
modules = {}

# Sample:
# ["category", "field ID", "default value", T("Readable Category Name"), T("Title of Field: "),"input type"],
# if input type is select
# ["category", "field ID", "default value", T("Readable Category Name"), T("Title of Field: "), "select", ["option 1", "option 2", . . .],
settings = []

#holds each line of 000_config for easy editing
config_file = []

# category.field_id : [readable category name, field title, type of input (select, text, password), [select options]]
settings_ui = {
    "database.db_type":[T("Database"), T("Database Type: "), "select", ["sqlite", "sql", "mysql"]],
    "database.host":[T("Database"), T("Host: "),"text"],
    "database.port":[T("Database"), T("Port: "),"text"],
    "database.database":[T("Database"), T("Database: "),"text"],
    "database.username":[T("Database"), T("Username: "),"text"],
    "database.password":[T("Database"), T("Password: "),"password"],
    "database.pool_size":[T("Database"), T("Pool Size: "),"text"],
    
    "auth.hmac_key":[T("Authentication"), T("HMAC Key: "), "text"],
    "auth.registration_requires_verification":[T("Authentication"), T("Registration Requires Verification: "), "select", ["on", "off"]],
    "auth.registration_requires_approval":[T("Authentication"), T("Registration Requires Approval: "), "select", ["on", "off"]],
    
    "base.public_url":[T("Base"), T("Public URL: "), "text"],
    "base.migrate":[T("Base"), T("Migrate: "), "select", ["on", "off"]],
    "base.prepopulate":[T("Base"), T("Prepopulate: "), "select", ["on", "off"]],
    
    "mail.sender":[T("Mail"), T("Sender: "), "text"],
    "mail.approver":[T("Mail"), T("Approver: "), "text"],
    "mail.server":[T("Mail"), T("Mail Server: "), "text"],
    
    "L10n.utc_offset":[T("L10n"), T("UTC Offset: "), "text"]
}

# "field ID":["jquery validation requirements", "Tooltip for field"],

ui_helper = {
    "db_type":["required lettersonly", "Database type, drop down for supported (ex: sqlite)"],
    "host": ["required url_or_localhost", "The IP address of the server Eden is installed on; if only used on this computer, type localhost"],
    "port": ["digits", "The port on which the server is running (ex: 8000)"],
    "database": ["required lettersonly", "The name of the database running on the server (ex: sahana)"],
    "username": ["required lettersonly", "The username for the administrator"],
    "password": ["required password", "The password for the administrator"],
    "pool_size": ["required digits", "The maximum number of expected concurrent users"],
    
    "hmac_key": ["required lettersonly", "The HMAC key"],
    "registration_requires_verification": ["required", "Should users need to be verified before they can register?"],
    "registration_requires_approval": ["required", "Should users need to be approved before they can register?"],
    
    "public_url": ["url2", "The URL Eden can be publicly accessed from"],
    "migrate": ["required", "Should migration be enabled?"],
    "prepopulate": ["required", "Should pre-population be enabled?"],
    
    "sender": ["email", "The address e-mails should come from"],
    "approver": ["email", "The address e-mails should be approved by"],
    "server": ["url_or_localhost", "The mail server"],
    
    "utc_offset": ["utc_offset", "The UTC offset of the server\"s location"]
}

# server-side validation. this is lacking.
# "field ID":[WEB2PY_VALIDATION_KEY(lower_val, upper_val)],
validation_settings = {
    "port":[IS_INT_IN_RANGE(1, 65535)],
    "pool_size":[IS_INT_IN_RANGE(1, 3000)]
}

libraries = {
    "lxml":
        {
            "name": "lxml",
            "description": "To import and export XML, you need to install lxml",
            "link": "http://codespeak.net/lxml/installation.html"
        },
    "reportlab":
        {
            "name": "ReportLab",
            "description": "To output PDFs, you need to install ReportLab",
            "link": "http://www.reportlab.com/software/opensource/rl-toolkit/download/"
        },
    "xlwt":
        {
            "name": "xlwt",
            "description": "To output Excel spreadsheet files, you need to install xlwt",
            "link": "http://pypi.python.org/pypi/xlwt"
        },
    "shapely":
        {
            "name": "Shapely",
            "description": "To use the Geographic Information System (GIS), you need to install Shapely",
            "link": "http://pypi.python.org/pypi/Shapely/#downloads"
        },
    "geos":
        {
            "name": "GEOS",
            "description": "For certain GIS operations, you need to install GEOS",
            "link": "http://trac.osgeo.org/geos/"
        }
}
